package com.usian.controller;

import com.usian.common.model.member.Member;
import com.usian.common.untils.Result;
import com.usian.service.MemberFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: 2210A-project1
 * @package: com.usian.controller
 * @className: LoginController
 * @author: 莫洪维
 * @email: 1204315800@qq.com
 * @description: TODO
 * @date: 2023/8/22 15:33
 */
@RestController
@RequestMapping("/frontEnd")
public class LoginController {

    @Autowired
    private MemberFeignService memberFeignService;

    //登录方法
    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public Result login(@RequestBody Member member){
        //调用方法进行登录
        Result result = memberFeignService.login(member);
        return result;
    }

    /**
     * 修改密码方法
     * @param member
     * @return
     */
    @RequestMapping(value = "/changePassword",method = RequestMethod.POST)
    public Result changePassword(@RequestBody Member member){
        //调用方法进行修改密码
        Result result = memberFeignService.changePassword(member);
        return result;
    }
}
